Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Adds a compact button to plan tool results that allows users to start fresh from a proposed plan.

When clicked, replaces conversation history with a single compacted message containing the plan title (as H1) and full plan content. The plan's markdown formatting is preserved, making it readable and useful as a conversation starting point.

Changes

  • Thread workspaceId through MessageRenderer → ToolMessage → ProposePlanToolCall
  • Add "Compact Here" button to plan header (conditionally rendered when workspaceId available)
  • Implement handleCompactHere() handler that creates compacted CmuxMessage and calls replaceChatHistory()
  • Button shows "Compacting..." during operation and is disabled to prevent double-clicks

Implementation

Reuses existing /compact infrastructure:

  • window.api.workspace.replaceChatHistory() API
  • createCmuxMessage() factory
  • compacted metadata flag (shows 📦 badge)

4 files modified, 51 lines added. All type checks, lints, and builds pass.

Generated with cmux

Adds a compact button to ProposePlanToolCall that allows users to start
fresh from a proposed plan. When clicked, it replaces the conversation
history with a compacted message containing the plan content formatted
with the plan title as an H1 heading.

Changes:
- Thread workspaceId through MessageRenderer -> ToolMessage -> ProposePlanToolCall
- Add handleCompactHere handler that creates a compacted CmuxMessage
- Add 'Compact Here' button to plan header (only shown when workspaceId available)
- Preserve plan formatting in compacted message (title + plan content)
@ammario ammario enabled auto-merge October 9, 2025 16:46
@ammario ammario added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit d62c282 Oct 9, 2025
6 checks passed
@ammario ammario deleted the plan-compact branch October 9, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants